package 对象序列化流;

import java.io.Serializable;

public class Student implements Serializable {//序列化接口仅仅是一个标识接口,证明这个类可以被序列化或者反序列化
    private String name;
    private static final long serialVersionUID=42l;//让他每次的序列化ID都为这个值
    private int age;

    public int getAge() {

        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
